﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class ViewProps : IDisposable
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public ViewProps(IntPtr cPtr, bool cMemoryOwn)
		{
			this.swigCMemOwn = cMemoryOwn;
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(ViewProps obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~ViewProps()
		{
			this.Dispose();
		}

		public virtual void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_ViewProps(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
		}

		public ViewProps() : this(GlobalsPINVOKE.new_ViewProps(), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public uint m_vpId
		{
			get
			{
				uint result = GlobalsPINVOKE.ViewProps_m_vpId_get(this.swigCPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.ViewProps_m_vpId_set(this.swigCPtr, value);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public OdDbStub m_vpObjectId
		{
			get
			{
				IntPtr intPtr = GlobalsPINVOKE.ViewProps_m_vpObjectId_get(this.swigCPtr);
				OdDbStub result = (intPtr == IntPtr.Zero) ? null : new OdDbStub(intPtr, false);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.ViewProps_m_vpObjectId_set(this.swigCPtr, OdDbStub.getCPtr(value));
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public OdGiRegenType m_regenType
		{
			get
			{
				OdGiRegenType result = (OdGiRegenType)GlobalsPINVOKE.ViewProps_m_regenType_get(this.swigCPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.ViewProps_m_regenType_set(this.swigCPtr, (int)value);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public OdGsView.RenderMode m_renderMode
		{
			get
			{
				OdGsView.RenderMode result = (OdGsView.RenderMode)GlobalsPINVOKE.ViewProps_m_renderMode_get(this.swigCPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.ViewProps_m_renderMode_set(this.swigCPtr, (int)value);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public OdGeMatrix3d m_worldToEye
		{
			get
			{
				IntPtr intPtr = GlobalsPINVOKE.ViewProps_m_worldToEye_get(this.swigCPtr);
				OdGeMatrix3d result = (intPtr == IntPtr.Zero) ? null : new OdGeMatrix3d(intPtr, false);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.ViewProps_m_worldToEye_set(this.swigCPtr, OdGeMatrix3d.getCPtr(value));
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public OdGePoint3d m_cameraLocation
		{
			get
			{
				IntPtr intPtr = GlobalsPINVOKE.ViewProps_m_cameraLocation_get(this.swigCPtr);
				OdGePoint3d result = (intPtr == IntPtr.Zero) ? null : new OdGePoint3d(intPtr, false);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.ViewProps_m_cameraLocation_set(this.swigCPtr, OdGePoint3d.getCPtr(value));
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public OdGePoint3d m_cameraTarget
		{
			get
			{
				IntPtr intPtr = GlobalsPINVOKE.ViewProps_m_cameraTarget_get(this.swigCPtr);
				OdGePoint3d result = (intPtr == IntPtr.Zero) ? null : new OdGePoint3d(intPtr, false);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.ViewProps_m_cameraTarget_set(this.swigCPtr, OdGePoint3d.getCPtr(value));
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public OdGeVector3d m_cameraUpVector
		{
			get
			{
				IntPtr intPtr = GlobalsPINVOKE.ViewProps_m_cameraUpVector_get(this.swigCPtr);
				OdGeVector3d result = (intPtr == IntPtr.Zero) ? null : new OdGeVector3d(intPtr, false);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.ViewProps_m_cameraUpVector_set(this.swigCPtr, OdGeVector3d.getCPtr(value));
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public OdGeVector3d m_viewDir
		{
			get
			{
				IntPtr intPtr = GlobalsPINVOKE.ViewProps_m_viewDir_get(this.swigCPtr);
				OdGeVector3d result = (intPtr == IntPtr.Zero) ? null : new OdGeVector3d(intPtr, false);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.ViewProps_m_viewDir_set(this.swigCPtr, OdGeVector3d.getCPtr(value));
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public OdGePoint2d m_vpLowerLeft
		{
			get
			{
				IntPtr intPtr = GlobalsPINVOKE.ViewProps_m_vpLowerLeft_get(this.swigCPtr);
				OdGePoint2d result = (intPtr == IntPtr.Zero) ? null : new OdGePoint2d(intPtr, false);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.ViewProps_m_vpLowerLeft_set(this.swigCPtr, OdGePoint2d.getCPtr(value));
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public OdGePoint2d m_vpUpperRight
		{
			get
			{
				IntPtr intPtr = GlobalsPINVOKE.ViewProps_m_vpUpperRight_get(this.swigCPtr);
				OdGePoint2d result = (intPtr == IntPtr.Zero) ? null : new OdGePoint2d(intPtr, false);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.ViewProps_m_vpUpperRight_set(this.swigCPtr, OdGePoint2d.getCPtr(value));
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public double[] m_deviation
		{
			get
			{
				double[] result = Helpers.UnMarshaldoubleFixedArray(GlobalsPINVOKE.ViewProps_m_deviation_get(this.swigCPtr));
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.ViewProps_m_deviation_set(this.swigCPtr, Helpers.MarshaldoubleFixedArray(value));
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public double m_frontClip
		{
			get
			{
				double result = GlobalsPINVOKE.ViewProps_m_frontClip_get(this.swigCPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.ViewProps_m_frontClip_set(this.swigCPtr, value);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public double m_backClip
		{
			get
			{
				double result = GlobalsPINVOKE.ViewProps_m_backClip_get(this.swigCPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.ViewProps_m_backClip_set(this.swigCPtr, value);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public OdDbStubPtrArray m_frozenLayers
		{
			get
			{
				OdDbStubPtrArray result = new OdDbStubPtrArray(GlobalsPINVOKE.ViewProps_m_frozenLayers_get(this.swigCPtr), false);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.ViewProps_m_frozenLayers_set(this.swigCPtr, OdDbStubPtrArray.getCPtr(value));
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public double m_linetypeScaleMultiplier
		{
			get
			{
				double result = GlobalsPINVOKE.ViewProps_m_linetypeScaleMultiplier_get(this.swigCPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.ViewProps_m_linetypeScaleMultiplier_set(this.swigCPtr, value);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public IntPtr m_renderModule
		{
			get
			{
				IntPtr result = GlobalsPINVOKE.ViewProps_m_renderModule_get(this.swigCPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.ViewProps_m_renderModule_set(this.swigCPtr, value);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public OdDbStub m_annoScale
		{
			get
			{
				IntPtr intPtr = GlobalsPINVOKE.ViewProps_m_annoScale_get(this.swigCPtr);
				OdDbStub result = (intPtr == IntPtr.Zero) ? null : new OdDbStub(intPtr, false);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.ViewProps_m_annoScale_set(this.swigCPtr, OdDbStub.getCPtr(value));
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public IntPtr m_filterFunction
		{
			get
			{
				IntPtr result = GlobalsPINVOKE.ViewProps_m_filterFunction_get(this.swigCPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.ViewProps_m_filterFunction_set(this.swigCPtr, value);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public uint m_nViewChanges
		{
			get
			{
				uint result = GlobalsPINVOKE.ViewProps_m_nViewChanges_get(this.swigCPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.ViewProps_m_nViewChanges_set(this.swigCPtr, value);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public void set(OdGsViewImpl view)
		{
			GlobalsPINVOKE.ViewProps_set(this.swigCPtr, OdGsViewImpl.getCPtr(view));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public uint difference(ViewProps props)
		{
			uint result = GlobalsPINVOKE.ViewProps_difference(this.swigCPtr, ViewProps.getCPtr(props));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isCompatibleWith(ViewProps props, uint nFlags, bool bCompareFrozenLayers)
		{
			bool result = GlobalsPINVOKE.ViewProps_isCompatibleWith__SWIG_0(this.swigCPtr, ViewProps.getCPtr(props), nFlags, bCompareFrozenLayers);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isCompatibleWith(ViewProps props, uint nFlags)
		{
			bool result = GlobalsPINVOKE.ViewProps_isCompatibleWith__SWIG_1(this.swigCPtr, ViewProps.getCPtr(props), nFlags);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isInvalid()
		{
			bool result = GlobalsPINVOKE.ViewProps_isInvalid(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setInvalid(bool bValue)
		{
			GlobalsPINVOKE.ViewProps_setInvalid(this.swigCPtr, bValue);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		private object locker = new object();

		private HandleRef swigCPtr;

		protected bool swigCMemOwn;
	}
}
